package cn.demoncat.util.exception;

/**
 * 自定义已检查异常根类
 *
 * @author 延晓磊
 *
 * @since 2017年3月26日
 */
public abstract class BaseCheckedException extends Exception{

	// 错误码
	private String code;

	public BaseCheckedException() {
		super();
	}
	
	public BaseCheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public BaseCheckedException(String message, Throwable cause) {
		super(message, cause);
	}

	public BaseCheckedException(String message) {
		super(message);
	}

	public BaseCheckedException(Throwable cause) {
		super(cause);
	}

	public BaseCheckedException(String message, String code, Throwable cause) {
		super(message, cause);
		this.code = code;
	}

	public BaseCheckedException(String message, String code) {
		super(message);
		this.code = code;
	}

	/**
	 * 错误码
	 *
	 * @return
	 */
	public String getCode() {
		return code;
	}

	/**
	 * 错误码
	 *
	 * @param code
	 * @return
	 */
	public BaseCheckedException setCode(String code) {
		this.code = code;
		return this;
	}
}
